#!/bin/bash

cd /etc/yum.repos.d/
mkdir repo
mv Cent* repo

# aliyun
curl -s -O  http://mirrors.aliyun.com/repo/Centos-7.repo
# 163
curl -s -O http://mirrors.163.com/.help/CentOS7-Base-163.repo
# 清除系统所有的yum缓存
yum clean all
# 生成yum缓存
yum makecache

# 安装epel源
yum install -y epel-release
# 安装aliyun epel源
curl -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

# 清除系统所有的yum缓存
yum clean all
# 生成yum缓存
yum makecache

# 查看系统可用的yum源和所有的yum源
yum repolist enabled